//FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md

import FairyEditor = CS.FairyEditor;
import { genCode } from './GenCode_TS';

function onPublish(handler: FairyEditor.PublishHandler) {
    if (!handler.genCode) return;
    handler.genCode = false; //prevent default output

    console.log('Handling gen code in plugin');
    genCode(handler); //do it myself
}

FairyEditor.App.menu.AddItem("发布流程控制", "自定义发布", (obj: string) => {
    console.log("发布流程控制");
});


function onDestroy() {
    // FairyEditor.App.menu.RemoveItem("自定义发布");
    //do cleanup here
}

export { onPublish, onDestroy };